<html>
<head></head>
<body>
<div id="header">
<?php
echo '<h1>this is a profile page</h1>';
?>
</div>
<div id="profile">

<?php 
//following Doza's MySQL connection example I will highlight what this page does.
$conn = new mysqli('localhost','root','','SEVENBITS','3306');
if(mysqli_connect_errno()){
echo "connection failed";
}else {
echo "connection successful";
}
$sql = "SELECT * FROM roledate,employees,roles Where employees.EmpID = roledate.EmpID AND roledate.RoleID = roles.RoleID";
$result = $conn->query($sql);
if($result->num_rows>0){
while($row = $result->fetch_assoc()){
//this line narrows down the query based on the variable in the addressbar given in the previous link 
//from the list of employees to the profile template.
if($row['EmpID']== $_GET["ID"] ){
//from multiple tables the view is made and this code pulls the information from them.
//the only reason it displays as a single value on the page is because of the WHERE in the query and 
//the if statement above narrowing down what we can see from each table
echo "<br> id: " . $row['EmpID']. " : " . $row['RoleName']. " : " ;
echo"<br><b>" . $row['EmpFname'] . "</b> : ". $row['ShiftStatus'];
//this link leads to another page for the individual employee's schedule taking thier ID as a variable
echo '<br><a href = "Schedule.php?ID=' . urlencode($row['EmpID'] ),'">Link to Schedule</a>';
}
}

}
else{
echo "0 results found ";
}

$conn->close();

?>

</div>
</body>
</html>